<template>
	<view class="pop-promot-box">
		<view class="pop-promot-back">
			<image class="pop-back-img" src="../static/image/homePage/diwen.png" mode="scaleToFill" />
			<!-- <image v-if="showClose" src="../static/image/fjj/close.png" class="close-btn" @click="close"></image> -->
			<view class="pop-content-back">
				<view class="pop-promot-title">{{title}}</view>
				<view class="text-content-view">
					<image mode="widthFix" class="img" @click="pictureMain(0)"
						src="../static/image/games/tips/keyboard_1.png"></image>
				</view>
				<view style="margin-top: 20px;" class="text-content-view" @click="pictureMain(1)">
					<image mode="widthFix" class="img" src="../static/image/games/tips/keyboard_2.png"></image>
				</view>
				<view class="pop-promot-button" @click="confirm">{{btnTxt}}</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			title: {
				type: String,
				default: '提示'
			},
			msg: {
				optionalTypes: String | null,
				default: ''
			},
			btnTxt: {
				type: String,
				default: '确定'
			},
			showClose: {
				type: Boolean,
				default: false
			},
			showKefu: {
				type: Boolean,
				default: false
			},
			align: {
				type: String,
				default: 'center'
			}
		},
		data() {
			return {
				imageList: ["/static/image/games/tips/keyboard_1.png","/static/image/games/tips/keyboard_2.png"],
			}
		},
		methods: {
			pictureMain(index) {
				uni.previewImage({
					urls: this.imageList, //需要预览的图片http链接列表，多张的时候，url直接写在后面就行了
					current: this.imageList[index], // 当前显示图片的http链接，默认是第一个
					success: function(res) {},
					fail: function(res) {},
					complete: function(res) {},
				})
			},
			confirm: function(e) {
				this.$emit('confirm');
			},
			close() {
				this.$emit('close');
			}
		},
	}
</script>

<style lang="less">
	.pop-promot-box {
		width: 100%;
		height: 100%;
		position: fixed;
		background-color: rgba(0, 0, 0, 0.5);
		z-index: 10000;
		top: 0;
		left: 0;
		display: flex;
		justify-content: center;
		align-items: center;
	}

	/* .pop-promot-back{
	    padding: 40rpx;
	    width: 70%;
	    margin: 0 15%;
	    border-radius: 20rpx;
	    background: #fff;
	    box-sizing: border-box;
	    display: flex;
	    flex-direction: column;
	    align-items: center;
	    justify-content: center;
	  } */
	.pop-back-img {
		width: 100%;
		height: 100%;
		top: 0px;
		left: 0px;
		z-index: 99;
		position: absolute;
	}

	.pop-content-back {
		width: 100%;
		height: 100%;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		z-index: 100;
	}

	.pop-promot-back {
		padding: 5% 5%;
		// width: 80%;
		margin: 0 10%;
		border-radius: 10px;
		/* background-image: url(https://cdn.spbcn.org/spbcnappneed/onlineGameRuleBackView2.png);
	    background-repeat: no-repeat;
	    background-size: 100% 100%;  box-sizing: border-box; */
		background: linear-gradient(0deg, #130E00 0%, #373632 100%);
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		position: relative;
	}


	.pop-promot-count {
		font-size: 14px;
		color: black;
		text-align: center;
		font-weight: 600;
		padding: 10px 15px;
		border-radius: 10px;
		margin-top: 5px;
		color: #fff;
	}

	.pop-promot-button {
		margin-top: 13px;
		width: 120px;
		height: 32px;
		border-radius: 32px;
		color: #000;
		font-size: 14px;
		font-family: 'hzgb';
		text-align: center;
		background: linear-gradient(to bottom, #ffd16b, #fff497);
		box-shadow: 0px 6px 0px 0px #d9b059;
		line-height: 32px;
	}

	.pop-promot-title {
		font-size: 18px;
		color: white;
		text-align: center;
		margin-bottom: 8px;
		font-family: 'hzgb';
		// text-shadow: -1px 1px 0 #992722, 1px 1px 0 #992722,1px -1px 0 #992722,-1px -1px 0 #992722;
		// -webkit-text-stroke: 1px #992722;
	}

	.text-content-view {
		// width: 90%;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		// padding: 15px;
		box-sizing: border-box;
	}

	.close-btn {
		position: absolute;
		right: 18px;
		top: 16px;
		z-index: 1000;
		width: 24px;
		height: 24px;
	}

	.kefu {
		.txt {
			text-align: center;
			color: #fff;
			font-size: 12px;
			margin-bottom: 10px;
		}

		.img {
			width: 200px;
			height: 200px;
		}
	}
</style>